import { Matches } from 'class-validator';
import { regPositive } from 'src/utils/regex.util';
import { ApiProperty } from '@nestjs/swagger';

export class ListDTO {
  @ApiProperty({
    description: '页码',
    required: false,
    default: 1,
  })
  @Matches(regPositive, { message: 'page 必须为正数且不小于1' })
  readonly page?: number;

  @ApiProperty({
    description: '每页数量',
    required: false,
    default: 10,
  })
  @Matches(regPositive, { message: 'pageSize 必须为正数且不小于1' })
  readonly pageSize?: number;

  @ApiProperty({
    description: '标签id',
    required: false,
  })
  readonly tagId?: number;
}
